﻿using SassModule.Entity;
using SassModule.ViewModel;
using System;
using System.Collections.Generic;

namespace SassModule.Contracts
{
    /// <summary>
    /// 角色服务
    /// </summary>
    public interface IRoleService
    {
        /// <summary>
        /// 角色列表
        /// </summary>
        /// <param name="dbStr"></param>
        /// <returns></returns>
        IEnumerable<Role> Index(string dbStr = null);

        /// <summary>
        /// 根据Id获取角色信息
        /// </summary>
        /// <param name="id">角色Id</param>
        /// <param name="dbStr"></param>
        /// <returns></returns>
        Role Index(Guid id,string dbStr = null);
        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="info"></param>
        /// <param name="dbStr"></param>
        /// <returns></returns>
        string Add(Role info,string dbStr = null);
        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="id"></param>
        /// <param name="dbStr"></param>
        void Del(Guid id, string dbStr = null);
        /// <summary>
        /// 返回角色下的菜单
        /// </summary>
        /// <param name="id"></param>
        /// <param name="dbStr"></param>
        /// <returns></returns>
        IEnumerable<string> GetMenus(Guid id, string dbStr = null);
        /// <summary>
        /// 给角色设置菜单
        /// </summary>
        /// <param name="id">角色Id</param>
        /// <param name="menus">菜单</param>
        /// <param name="dbStr"></param>
        void SetMenus(Guid id, List<string> menus, string dbStr=null);

        /// <summary>
        /// 编辑用户
        /// </summary>
        /// <param name="info"></param>
        void UpdateRoles(Role info);
    }
}
